import {MessageType} from "@/store/chatStore";
import {ReactNode} from "react";

export type Contact = {
  id: number;
  avatar?: string;
  nickname?: string;
  message?: string;
  date?: string;
  desc?: string | ReactNode;
};

type Message = {
  to?: number
  from?: number
  data?: string
  type: MessageType
  id?: number
}

type MessageData = {
  _id: string,
  date: number,
  user: {
    id: number,
    avatar: string,
    nickname: string,
    desc: string,
  },
  message: {
    type: string,
    content: string,
  },
}

export type MessageDataMap = {[keys:number]:MessageData[]}